1. Field of the Invention
The present invention is directed to computer systems; and more particularly, it is directed to utilization of graphics processors associated with computer systems for anti-aliasing operations.
2. Description of the Related Art
As the power and complexity of personal computer systems increase, graphics operations are increasingly being performed using dedicated graphics rendering devices referred to as graphics processing units (GPUs). As used herein, the terms “graphics processing unit” and “graphics processor” are used interchangeably. GPUs are often used in removable graphics cards that are coupled to a motherboard via a standardized bus (e.g., AGP or PCI Express). GPUs may also be used in game consoles and in integrated graphics solutions (e.g., for use in some portable computers and lower-cost desktop computers). Although GPUs vary in their capabilities, they may typically be used to perform such tasks as rendering of two-dimensional (2D) graphical data, rendering of three-dimensional (3D) graphical data, accelerated rendering of graphical user interface (GUI) display elements, and digital video playback. A GPU may implement one or more application programmer interfaces (APIs) that permit programmers to invoke the functionality of the GPU.
To reduce demands on central processing units (CPUs) of computer systems, GPUs may be tasked with performing operations that would otherwise contribute to the CPU load. Accordingly, modern GPUs are typically implemented with specialized features for efficient performance of common graphics operations. For example, a GPU often includes a plurality of execution channels that can be used simultaneously for highly parallel processing. A GPU may include various built-in and configurable structures for rendering digital images to an imaging device.
Digital images may include raster graphics, vector graphics, or a combination thereof. Raster graphics data (also referred to herein as bitmaps) may be stored and manipulated as a grid of individual picture elements called pixels. A bitmap may be characterized by its width and height in pixels and also by the number of bits per pixel. Commonly, a color bitmap defined in the RGB (red, green blue) color space may comprise between one and eight bits per pixel for each of the red, green, and blue channels. An alpha channel may be used to store additional data such as per-pixel transparency values. Vector graphics data may be stored and manipulated as one or more geometric objects built with geometric primitives. The geometric primitives (e.g., points, lines, paths, polygons, Bézier curves, and text characters) may be based upon mathematical equations to represent parts of vector graphics data in digital images. The geometric objects may typically be located in two-dimensional or three-dimensional space. To render vector graphics on raster-based imaging devices (e.g., most display devices and printers), the geometric objects are typically converted to raster graphics data in a process called rasterization.
The rasterization process may result in undesirable aliasing. Aliasing is typically defined as the introduction of artifacts resulting from a wide-bandwidth signal being sampled at an insufficiently high sampling rate. Visible “jaggies” in a rendered image are an example of aliasing. Typically, aliasing is most noticeable on objects with non-orthogonal edges. Anti-aliasing techniques may be used to reduce the effects of aliasing and provide a smoother appearance for those edges. A typical approach to anti-aliasing includes low-pass filtering of a signal (e.g., by the averaging or other smoothing of pixel data) to reduce its bandwidth and thereby reduce anti-aliasing artifacts. However, low-pass filtering a signal may result in the “spreading” of the signal. For example, if a sharp edge (e.g., a stair or step function) is low-pass filtered or otherwise smoothed, the sharp edge may “spread” to become a soft edge in which the transition from edge's low value to its high value is spread over more pixels. Thus, the smoothed object may cover a slightly larger area (in device pixels, e.g., expanding the area out by one or two device pixels) than the original un-smoothed object.
As noted above, one of the geometric elements often rendered using a GPU is a path. A path may be a closed contour, and a geometric shape may be defined as the region enclosed by a closed path. A path may include straight lines and/or curve segments. Typically, regions enclosed by paths are rendered on a GPU by tessellating the region enclosed by the path to produce a collection of covering triangles that are each rendered on the GPU to a target device. However, because device pixels of a target device are larger at lower resolutions than at higher resolutions, typical approaches to anti-aliasing may produce a device-dependent path which is larger at low resolutions and smaller (i.e., closer in size to the ideal size of the original path) at high resolutions.
This problem has been addressed in the past by making the area to be filtered large enough to include all of the pixels that would be filtered at the lowest resolution. However, this approach often has the disadvantage of including many extra pixels at higher resolutions. For example, a 1 pixel spread of the bound at 72 dpi maps to a 10 device pixel spread at 720 dpi when a fixed spread is used. Thus, this approach may significantly increase the number of pixels that are unnecessarily filtered, cause a performance penalty, and introduce possible quality issues (especially, for example, at tight corners). An alternative approach is to define smaller zoom ranges so that the spread is smaller at the higher resolutions in the range and so that there are fewer wasted pixels. However, this may require re-tessellation as the path shape changes, and the number of re-tessellations may be tied to the size of the zoom range over which the tessellations can be used. Because tessellation of a path may be computationally expensive, it is desirable to avoid re-tessellating paths.
GPUs typically render with a center scan rule, while some applications (e.g., those using the Adobe® Imaging Model) may use an overscan rule for rendering. Center scan rendering follows a rendering rule for coloring device pixels that assigns to a pixel the color at the point on the graphic object that maps to the pixel's center. Thus, a thin graphic element (e.g., a thin strokefill) may not color any pixels at low resolutions using a center scan rule. In contrast, overscan rendering follows a rendering rule for coloring device pixels that assigns to a pixel the color of a graphic object touching the pixel. Thus, a thin graphic element (e.g., a thin strokefill) will always color pixels, even at low resolutions, using an overscan rule. If a path has thin or narrow sections, these sections may fail to render with the center scan rule when the center of a pixel is not enclosed by the path. For example, a thin horizontal stroke may not render at all if its path does not include a device pixel center. The position of pixel centers, relative to the path, may change with resolution such that paths may appear and disappear as a page is zoomed. This undesirable phenomenon is referred to as thin element dropout.